<?php
/**
 * Created by PhpStorm.
 * User: chengenghong
 * Date: 2021-09-18
 * Time: 15:38
 */
namespace G244\Builder;

class ConcreteBuilder1 implements Builder
{
    private $product;


    public function __construct()
    {
        $this->reset();
    }

    public function reset(): void
    {
        $this->product = new \G244\Builder\Product1();
    }
    public function productPartA(): void
    {
        $this->product->parts[] = "PartA1";
    }

    public function productPartB(): void
    {
        $this->product->parts[] = "PartB1";
    }

    public function productPartC(): void
    {
        $this->product->parts[] = "PartC1";
    }

    public function getProduct(): Product1
    {
        $result = $this->product;
        $this->reset();

        return $result;
    }

}
